 //
//  UIBarButtonItem+LYZExtension.m
//  01-百思不得姐
//
//  Created by 李昱铮 on 16/8/23.
//  Copyright © 2016年 LYZ. All rights reserved.
//

#import "UIBarButtonItem+LYZExtension.h"

@implementation UIBarButtonItem (LYZExtension)

+ (instancetype)itemWithImage:(NSString *)image heighImage:(NSString *)heighImage target:(id)target action:(SEL)action
{
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setBackgroundImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [button setBackgroundImage:[UIImage imageNamed:heighImage] forState:UIControlStateHighlighted];
    button.size = button.currentBackgroundImage.size;
    [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];

    return [[self alloc]initWithCustomView:button];
}

@end
